﻿using UnityEngine;
using System.Collections;

namespace UI
{
    public class UILuckThreeHeroTemplate : UILuckHeroTemplate
    {
        #region 英雄头像
        public UITexture hero0;
        public UITexture hero1;
        public UITexture hero2;
        #endregion

        #region 底框
        public UISprite heroFrame0;
        public UISprite heroFrame1;
        public UISprite heroFrame2;
        #endregion

        #region 拥有
        public GameObject mask0;
        public GameObject mask1;
        public GameObject mask2;
        #endregion


        #region 激活
        public GameObject actived0;
        public GameObject actived1;
        public GameObject actived2;
        #endregion
        public override void SetIcon()
        {
            MainTexture(hero0,heros[0].heroData.iconName);
            MainTexture(hero1,heros[1].heroData.iconName);
            MainTexture(hero2,heros[2].heroData.iconName);

            heroFrame0.spriteName = GetFrameRes(heros[0].heroData.quality);
            heroFrame1.spriteName = GetFrameRes(heros[1].heroData.quality);
            heroFrame2.spriteName = GetFrameRes(heros[2].heroData.quality);
        }

        protected override void Actived(bool yes0, bool yes1 = false, bool yes2 = false)
        {
            actived0.SetActive(yes0);
            actived1.SetActive(yes1);
            actived2.SetActive(yes2);
        }

        protected override void Masked(bool yes0, bool yes1 = false, bool yes2 = false)
        {
            mask0.SetActive(yes0);
            mask1.SetActive(yes1);
            mask2.SetActive(yes2);
        }

        public override void OnClick()
        {
            UILuck.ShowLuckPopupBox(luck.luckData.id);
        }

    }
}
